namespace Blog2025.Application.Dto;

public class PageRequestDto
{
    private int _pageIndex =1;
    private int _pageSize =10;

    private readonly int MinPageSize =10;
    private readonly int MaxPageSize=100;

    public int PageIndex
    {
        get=>_pageIndex;
        set=>_pageIndex=value<1?1:value;   //页码小于1时，自动设置为1
    }
    public int PageSize
    {
        get=>_pageSize;
        set=>_pageSize=value<1?MinPageSize:(value>MaxPageSize?MaxPageSize:value);
        // 页目条数最大为100，最小为10
    }
}